#define _CRT_SECURE_NO_WARNINGS 1

#include <stdlib.h>
#include <stdio.h>

int cmp_int(const void* a, const void* b)
{
    return *((int*)a) - *((int*)b);
}

int majorityElement(int* nums, int numsSize)
{
    qsort(nums, numsSize, sizeof(int), cmp_int);
    return nums[numsSize / 2];
}